package com.qinhao.loveCrowdFunding.mapper;

import com.qinhao.loveCrowdFunding.pojo.Message;
import com.qinhao.loveCrowdFunding.pojo.MessageWriteByUserIdEntity;
import com.qinhao.loveCrowdFunding.req.MessageStatusConvertByIdRequest;
import com.qinhao.loveCrowdFunding.req.UserMessageRequest;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MessageMapper {
    // 获取未读的消息
    List<Message> getUnReadMessageByUserId(UserMessageRequest userMessageRequest);
    // 获取已读的消息
    List<Message> getReadMessageByUserId(UserMessageRequest userMessageRequest);
    // 获取垃圾箱中的消息
    List<Message> getRecycleMessageByUserId(UserMessageRequest userMessageRequest);
    // 通过信息的id将未读的消息转为已读的消息
    void unRead2ReadById(MessageStatusConvertByIdRequest messageStatusConvertRequest);
    // 通过信息的id将已读的消息放入回收站
    void read2RecycleById(MessageStatusConvertByIdRequest messageStatusConvertRequest);
    // 通过信息的id将回收站的信息还原为已读
    void recycle2ReadById(MessageStatusConvertByIdRequest messageStatusConvertRequest);
    // 将未读的消息转为已读的消息
    void unRead2Read();
    // 将已读的消息放入回收站
    void read2Recycle();
    // 将回收站的信息还原为已读
    void deleteRecycle();
    // 根据用户的id写入未读消息
    void addUnreadMessageByUserId(MessageWriteByUserIdEntity messageWriteByUserIdEntity);
}
